package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：账号状态枚举
 *
 * @author jun.liu
 */
public enum MemberStateTypes implements EnumerableValue
{

    DISABLED(-99, "禁用"),
    LOCKED(-50, "锁定"),
    NORMAL(0, "正常");

    public static class Converter extends BaseEnumValueConverter<MemberStateTypes>
    {
    }

    private int value;
    private String desc;

    private MemberStateTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static MemberStateTypes getUserStateByValue(int codeVal)
    {
        for (MemberStateTypes userState : MemberStateTypes.values())
        {
            if (userState.getValue() == codeVal)
            {
                return userState;
            }
        }
        return null;
    }

}
